package com.like.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.like.fragment.ImgPagerFragment;
import com.like.hospitalworld.R;

public class ImgPagerAdapter extends FragmentPagerAdapter {

    private ImgPagerFragment mImg1Fragment, mImg2Fragment, mImg3Fragment;

    private ImgPagerFragment[] mFragments;

    public ImgPagerAdapter(FragmentManager fm) {
        super(fm);
        mImg1Fragment = new ImgPagerFragment();
        mImg1Fragment.setImgResourceId(R.drawable.tmp_doc);
        mImg2Fragment = new ImgPagerFragment();
        mImg2Fragment.setImgResourceId(R.drawable.tmp_doc);
        mImg3Fragment = new ImgPagerFragment();
        mImg3Fragment.setImgResourceId(R.drawable.tmp_doc);
        mFragments = new ImgPagerFragment[]{mImg1Fragment, mImg2Fragment, mImg3Fragment};
    }

    public int getRealCount() {
        return mFragments.length;
    }

    @Override
    public Fragment getItem(int position) {
        ImgPagerFragment imgFragment = new ImgPagerFragment();
        imgFragment.setImgResourceId(R.drawable.tmp_doc);
        return imgFragment;
    }

    @Override
    public int getCount() {
        return Integer.MAX_VALUE;
    }
}
